<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title th:text="${data.pageTitle}+${title}">search</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" href="/favicon.svg" type="image/x-icon">
    <link rel="stylesheet" th:href="${public_cdn + '/layui/2.6.8/css/layui.min.css'}">
    <link rel="stylesheet" href="/static/main/main.css">
</head>
<body>
<div class="page-wrapper">

    <div th:include="header"></div>

    <div class="page-main" id="searchpage">

        <input type="hidden" id="searchType" th:value="${data.searchType}">

        <div class="grid links">
            <div class="grid-col" th:each="result: ${data.resultList}">
                <a th:href="${result.url}" target="_blank">
                    <div class="link-item">
                        <div class="link-info">
                            <h2 th:text="${result.title}">文章标题</h2>
                            <p class="excerpt" th:if="${result.digest == null || result.digest == ''}"
                               th:text="${result.title}"></p>
                            <p class="excerpt" th:if="${result.digest != null && result.digest != ''}"
                               th:text="${result.digest}"></p>
                            <p class="link-meta">
                                <span class="date fl">
                                    <span class="source" th:text="${result.postDate}"></span>
                                    <span class="source" th:text="${result.source}"></span>
                                </span>
                                <span class="view fr">
                                    <span class="tag" th:each="tag: ${result.tags}" th:text="${tag}"></span>
                                </span>
                            </p>
                        </div>
                    </div>
                </a>
            </div>
        </div>

        <div class="pager" th:if="${page != null}">
            <div class="box">
                <a class="prev" th:if="${page.hasPrevious()}"
                   th:href="${'/' + data.searchType + '?key=' + data.searchKey + '&page='+ (page.current-1)}">
                    <span><i class="fas czs-angle-left-l"></i></span>
                </a>
                <div class="nav_pagenum">
                    <span th:text="${page.current + ' / ' + page.getPages()}"></span>
                </div>
                <a class="next" th:if="${page.hasNext()}"
                   th:href="${'/' + data.searchType + '?key=' + data.searchKey + '&page=' + (page.current+1)}">
                    <span><i class="fas czs-angle-right-l"></i></span>
                </a>
            </div>
        </div>

    </div>

    <div th:include="footer"></div>

</div>
<script th:src="${public_cdn + '/layui/2.6.8/layui.min.js'}"></script>
<script src="/static/main/main.js"></script>
</body>
</html>
